﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace WebberCross.JavaScriptBridge.WebParts
{
    /// <summary>
    /// Used for sending details about the control to JSBridge
    /// </summary>
    [DataContract]
    public class JSClientObject
    {
        private string _jsClientID = "";
        private string _jsClientSourceID = "";
        private string _jsUniqueClientID = "";

        [DataMember]
        public string JSClientID
        {
            get { return this._jsClientID; }
            set { this._jsClientID = value; }
        }

        [DataMember]
        public string JSClientSourceID
        {
            get { return this._jsClientSourceID; }
            set { this._jsClientSourceID = value; }
        }

        [DataMember]
        public string JSUniqueClientID
        {
            get { return this._jsUniqueClientID; }
            set { this._jsUniqueClientID = value; }
        }

        public JSClientObject()
        {

        }

        public JSClientObject(string jsClientID, string jsClientSourceID, string jsUniqueClientID)
        {
            this._jsClientID = jsClientID;
            this._jsClientSourceID = jsClientSourceID;
            this._jsUniqueClientID = jsUniqueClientID;
        }

        public string ToJASON()
        {
            return JSONHelper.Serialize<JSClientObject>(this);
        }
    }


}
